<template></template>
<script setup>
import { onMounted } from 'vue'

/*
选项api生命周期
beforeCreate
created
beforeMount
mounted
beforeUpdate
updated
beforeUnmount
unmounted
activated
deactivated

组合api生命周期
beforeCreate==>setup
created=======>setup
beforeMount===>onBeforeMount
mounted=======>onMounted
beforeUpdate==>onBeforeUpdate
updated=======>onUpdated
beforeUnmount=>onBeforeUnmount
unmounted=====>onUnmounted
activated=====>onActivated
deactivated===>onDeactivated
用法
1：导入  import {onMounted} from 'vue'
onMounted(()=>{
  ....
})
onMounted(()=>{
  ....
})
onMounted(()=>{
  ....
})

变化：
  1：beforeDestroy==>beforeUnmount
     destroyed======>unmounted
  2:组合api去掉 beforeCreate与created
  3:组合api下都要加on
  4:用法上，都要导入再使用，且可多次使用
*/

onMounted(() => {
  console.log('渲染后')
})
</script>
